package lanqiaobei;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class butonzichuan {
public static void main(String[] args) {
	//Scanner scanner = new Scanner(System.in);
	int k=0;
	String string = "0100110001010001";
	String[] arr = new String[100000];
	for (int i = 0; i < string.length(); i++) {
		for (int j = i+1; j <= string.length(); j++) {
			arr[k] = string.substring(i, j);
			k++;
		}
	}
	Set<String> set = new HashSet<String>();
	for (int i = 0; i < k; i++) {
		set.add(arr[i]);
	}
	System.out.println(set.size());
}
}
